'use client'
import Link from "next/link"; // Import the Link component from Next.js re
import { useRouter, useSearchParams } from 'next/navigation';

function Home() {
  const router = useRouter();
  const searchParams = useSearchParams();

  // const updateSorting = (sortOrder) => {
  //   const params = new URLSearchParams(searchParams.tsString());
  //   params.set('sort', sortOrder);  // 更新排序参数
  //   window.history.pushState('/about', "", `/about?${params.toString()}`)  // 更新URL
  // }

  return (
    <div style={{ height: '200vh' }}>
      <h1>home</h1>
      <p>Welcome to your home.</p>
      <Link scroll={false} href='/about?id=123'>去关于页面</Link>
      <br></br>
      <button type="button" onClick={() => router.push('/about')}>go about</button>
      <br></br>
      {/* <h2 onClick={() => updateSorting('abc')}>去关于</h2> */}
    </div>
  );
}

export default Home;